import Vue from 'vue'
import VueRouter from 'vue-router'
import Layout from '@/views/Layout'
import Home from '@/views/Home'
import Login from '@/views/Login'
import Profile from '@/views/Profile'
import FindHouse from '@/views/FindHouse'
import Favorate from '@/views/Favorate'
import Detail from '@/views/Detail'
import CityList from '@/views/CityList'
import FindMap from '@/views/FindMap'
import RendOut from '@/views/RendOut'
import Search from '@/views/RendOut/Search'
import MyRenout from '@/views/Profile/MyRenout'

Vue.use(VueRouter)

const routes = [
  {
    path: '/',
    redirect: '/layout/home'
  },
  {
    path: '/layout',
    component: Layout,
    children: [
      {
        path: '/layout/home',
        component: Home
      },

      {
        path: '/layout/findhouse',
        component: FindHouse
      },
      {
        path: '/layout/profile',
        component: Profile
      }
    ]
  },
  {
    path: '/login',
    component: Login
  },
  {

    path: '/favorate',
    component: Favorate
  },
  {
    path: '/detail/:id',
    component: Detail,
    props: true
  },
  {
    path: '/citylist',
    component: CityList
  },
  {
    path: '/rendout',
    component: RendOut
  },
  {
    path: '/map',
    component: FindMap
  }, {
    path: '/search',
    component: Search
  },
  {
    path: '/myrenout',
    component: MyRenout
  }

]

const router = new VueRouter({
  routes
})

export default router
